from ccframe import Router, Application
from webob import Response

router = Router()


@router.route('/')
# ctx与request参数，不管用不用，都要传入
def main(ctx, request):
    return Response('hello world')


app = Application([router])
# app.add_router(router)

if __name__ == "__main__":
    from wsgiref.simple_server import make_server

    server = make_server('0.0.0.0', 3001, app)
    try:
        server.serve_forever()
    except KeyboardInterrupt:
        server.shutdown()
